﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AutoRetailsDLL.Workers
{
    public class WorkResult
    {
        /// <summary>
        /// 成功为0,失败为1
        /// </summary>
        public int erroCode { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public string errorMessage { get; set; }
        /// <summary>
        /// 成功
        /// </summary>
        /// <returns></returns>
        public static WorkResult WorkSuccess() 
        {
            return new WorkResult() { erroCode=0,errorMessage="success"};

        }
        public static WorkResult WorkSuccess(string msg)
        {
            return new WorkResult() { erroCode = 0, errorMessage = msg };

        }
        /// <summary>
        /// 失败
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static WorkResult WorkFailed(string msg)
        {
            return new WorkResult() { erroCode = 1, errorMessage = msg };

        }
        /// <summary>
        /// 失败
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static WorkResult WorkFailed()
        {
            return new WorkResult() { erroCode = 1, errorMessage = "failed" };

        }
    }

}
